import React from 'react'
import { Route, IndexRoute } from 'react-router'

import {
  App,
  Home,  //主页
	JumpUrl, //空白页
	AuthError, //授权失败页
	HandleList, //立即办理列表
	Paysuccess, //支付成功页
	Payment, //订单确认页
	HandlingProgress, //进度详情
	AddAddress, //添加地址
	AddressEdit, //编辑地址
	AddressList,  //地址列表
	OrderList, //我的订单
	OrderDetails, //订单详情页
	AddPass, //添加通行证
	PassInformation, //通行证信息页，订单详情页进入
 
  TwHome,    //台湾签注主页
  TwPayment, //订单确认页
  TwAddPass,//添加通行证
  TwPassInformation, //通行证信息
  TwHandleList, //办理列表
  TwPaysuccess, //支付成功
  TwOrderDetails, //订单详情
  TwHandlingProgress, //订单呢进度
  NotFoundPage,
} from './containers'

export default (
  <Route path="/" component={App}>
    <IndexRoute component={JumpUrl}/>
    <Route path="home" components={Home}/>
    <Route path="authError" components={AuthError}/>
    <Route path="handleList" components={HandleList}/>
    <Route path="paysuccess" components={Paysuccess}/>
    <Route path="payment" components={Payment}/>
    <Route path="handlingProgress/:orderId/:chargeId" components={HandlingProgress}/>
    <Route path="addAddress" components={AddAddress}/>
    <Route path="addressEdit/:addressId" components={AddressEdit}/>
    <Route path="addressList" components={AddressList}/>
    <Route path="orderList(/:type)" components={OrderList}/>
    <Route path="orderDetails/:orderId/:chargeId(/:type)" components={OrderDetails}/>
    <Route path="addPass(/:id)(/:type)" components={AddPass}/>
    <Route path="passInformation(/:type)" components={PassInformation}/>

    <Route path="twHome" components={TwHome}/>
    <Route path="twPayment" components={TwPayment}/>
    <Route path="twAddPass(/:id)(/:type)" components={TwAddPass}/>
    <Route path="twPassInformation(/:type)" components={TwPassInformation}/>
    <Route path="twHandleList" components={TwHandleList}/>
    <Route path="twPaysuccess" components={TwPaysuccess}/>
    <Route path="twOrderDetails/:orderId/:chargeId(/:type)" components={TwOrderDetails}/>
    <Route path="twHandlingProgress/:orderId/:chargeId" components={TwHandlingProgress}/>

    {/*<Route path="路由地址" getComponents={(nextState, cb) => {
        require.ensure([], (require) => {
          cb(null, require('./组件路径/按需加载demo').default)
        }, 'chunkName')
      }} />*/}
    <Route path="*" component={NotFoundPage}/>
  </Route>
);